﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using SilverApp.View;

namespace SilverApp.ViewModel
{
    public class FileWindowViewModel
    {
        public FileWindow view;
        public FileItemViewModel item;
        public FolderViewModel parent;

        public FileWindowViewModel(FolderViewModel xparent, FileWindow xview, FileItemViewModel xitem)
        {
            parent = xparent;
            view = xview;
            item = xitem;
        }

        public FileWindowViewModel(FileWindow xview, FileItemViewModel xitem)
        {
            view = xview;
            item = xitem;
        }

        public FileWindowViewModel(FileWindowViewModel xcopy)
        {
            view = xcopy.view;
            item = xcopy.item;
        }


        public LiveService.File Model
        {
            get { return this.item.Model; }
        }

        public String ModelName
        {
            get { return this.item.Model.name; }
            set { this.item.Model.name = value; }
        }

        public ICommand OpenFileCommand
        {
            get { return this.parent.OpenFileCommand; }
            set { this.parent.OpenFileCommand = value; }
        }

        public ICommand ReopenFileCommand
        {
            get { return this.parent.ReopenFileCommand; }
            set { this.parent.ReopenFileCommand = value; }
        }

        public FileWindowViewModel Selected
        {
            get { return new FileWindowViewModel(this); }
        }
    }
}
